home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1997 January / macformat-046.iso / Shareware Plus / Developers / EnterAct / EnterAct Stuff / hAWK project / AWK Headers / AWK.H < prev    next >
Encoding:
C/C++ Source or Header  |  1995-04-07  |  17.3 KB  |  643 lines  |  [TEXT/TOPC]

  1. /*
  2.  * awk.h -- Definitions for gawk/hawk. 
  3.  */
  4.  
  5. /* Copyright © 1986, 1988, 1989 1991 the Free Software Foundation, Inc.
  6.  *         This file is part of GAWK, the GNU implementation of the
  7.  * AWK Progamming Language, modified for the Macintosh (also called hAWK).
  8.  *         GAWK is free software; you can redistribute or modify
  9.  * it under the terms of the GNU General Public License as published by
  10.  * the Free Software Foundation; either version 1, or any later version.
  11.  *         GAWK is distributed in the hope that it will be useful,
  12.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14.  * GNU General Public License for more details.
  15.  *         You should have received a copy of the GNU General Public License
  16.  * along with GAWK; see the file "COPYING hAWK". If not, write to
  17.  * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  18.  * Modified for THINK C 4 on the Macintosh by Ken Earle (Dynabyte) Aug 1991.
  19.  */
  20. /* Mac note - in this file most of the declarations dealing with
  21. portability have been left in place. However, chunks of code not for the
  22. Mac version HAVE been chopped out in the overall project, and so if it is
  23. your ambition to produce a version of AWK for some other computer you should
  24. obtain the original ibm/unix version of this code. 
  25. */
  26. #ifndef MACVERSION
  27. #define MACVERSION 1
  28. #endif
  29.  
  30. /* ------------------------------ Includes ------------------------------ */
  31. #include <stdio.h>
  32. #include <ctype.h>
  33. #include <setjmp.h>
  34. #include <_stdarg.h>
  35. #include <errno.h>
  36. #ifndef MACVERSION
  37. #include <sys/types.h>
  38. #include <sys/stat.h>
  39. #else
  40. #include <stdlib.h>
  41. #include <math.h>
  42. #include <string.h>
  43. #include <unix.h>
  44. #include <time.h>
  45. #endif
  46.  
  47.  
  48. #include "REGEX.H"
  49.  
  50. /* ------------------- System Functions, Variables, etc ------------------- */
  51. #ifndef MACVERSION
  52. /* nasty nasty SunOS-ism */
  53. #ifdef sparc
  54. #include <alloca.h>
  55. #ifdef lint
  56. extern char *alloca();
  57. #endif
  58. #else
  59. extern char *alloca();
  60. #endif
  61. #ifdef SPRINTF_INT
  62. extern short sprintf();
  63. #else    /* not USG */
  64. /* nasty nasty berkelixm */
  65. #define setjmp    _setjmp
  66. #define longjmp    _longjmp
  67.  
  68. extern char *sprintf();
  69. #endif
  70. #endif
  71.  
  72. #ifdef MACVERSION
  73. extern void *alloca(unsigned short size);
  74. #endif
  75.  
  76. #ifndef MACVERSION
  77. /*
  78.  * if you don't have vprintf, but you are BSD, the version defined in
  79.  * vprintf.c should do the trick.  Otherwise, use this and cross your fingers.
  80. SEE iomisc.c, jes i got it.
  81.  */
  82. #if defined(VPRINTF_MISSING) && !defined(DOPRNT_MISSING) && !defined(BSDSTDIO)
  83. #define vfprintf(fp,fmt,arg)    _doprnt((fmt), (arg), (fp))
  84. #endif
  85. #endif
  86.  
  87. #ifdef MACVERSION
  88. extern short strcasecmp(char *s1, char *s2);
  89. extern short strncasecmp(char *s1, char *s2, register short n);
  90. #else
  91. #ifdef __STDC__
  92. extern void *malloc(unsigned), *realloc(void *, unsigned);
  93. extern void free(char *);
  94. extern char *getenv(char *);
  95.  
  96. extern char *strcpy(char *, char *), *strcat(char *, char *), *strncpy(char *, char *, short);
  97. extern short strcmp(char *, char *);
  98. extern short strncmp(char *, char *, short);
  99. extern short strncasecmp(char *, char *, short);
  100. extern char *strerror(short);
  101. extern char *strchr(char *, short);
  102. extern short strlen(char *);
  103. extern    char *memcpy(char *, char *, short);
  104. extern    short memcmp(char *, char *, short);
  105. extern    char *memset(char *, short, short);
  106.  
  107. /* extern short fprintf(FILE *, char *, ...); */
  108. extern short fprintf();
  109. extern short vfprintf();
  110. #ifndef MSDOS
  111. extern short fwrite(char *, short, short, FILE *);
  112. #endif
  113. extern short fflush(FILE *);
  114. extern short fclose(FILE *);
  115. extern short pclose(FILE *);
  116. #ifndef MSDOS
  117. extern short fputs(char *, FILE *);
  118. #endif
  119. extern void abort();
  120. extern short isatty(short);
  121. extern void exit(short);
  122. extern short system(char *);
  123. extern short sscanf(/* char *, char *, ... */);
  124.  
  125. extern double atof(char *);
  126. extern short fstat(short, struct stat *);
  127. extern off_t lseek(short, off_t, short);
  128. extern short fseek(FILE *, long, short);
  129. extern short close(short);
  130. extern short open();
  131. extern short pipe(short *);
  132. extern short dup2(short, short);
  133. #ifndef MSDOS
  134. extern short unlink(char *);
  135. #endif
  136. extern short fork();
  137. extern short execl(/* char *, char *, ... */);
  138. extern short read(short, char *, short);
  139. extern short wait(short *);
  140. extern void _exit(short);
  141. #else
  142. extern void _exit();
  143. extern short wait();
  144. extern short read();
  145. extern short execl();
  146. extern short fork();
  147. extern short unlink();
  148. extern short dup2();
  149. extern short pipe();
  150. extern short open();
  151. extern short close();
  152. extern short fseek();
  153. extern off_t lseek();
  154. extern short fstat();
  155. extern void exit();
  156. extern short system();
  157. extern short isatty();
  158. extern void abort();
  159. extern short fputs();
  160. extern short fclose();
  161. extern short pclose();
  162. extern short fflush();
  163. extern short fwrite();
  164. extern short fprintf();
  165. extern short vfprintf();
  166. extern short sscanf();
  167. extern char *malloc(), *realloc();
  168. extern void free();
  169. extern char *getenv();
  170.  
  171. extern short strcmp();
  172. extern short strncmp();
  173. extern short strncasecmp();
  174. extern short strlen();
  175. extern char *strcpy(), *strcat(), *strncpy();
  176. extern    char *memset();
  177. extern    short memcmp();
  178. extern    char *memcpy();
  179. extern char *strerror();
  180. extern char *strchr();
  181.  
  182. extern double atof();
  183. #endif
  184. #endif
  185.  
  186. extern int errno;
  187.  
  188. /* ------------------ Constants, Structures, Typedefs  ------------------ */
  189. #define AWKNUM    double
  190.  
  191. typedef enum {
  192.     /* illegal entry == 0 */
  193.     Node_illegal,
  194.  
  195.     /* binary operators  lnode and rnode are the expressions to work on */
  196.     Node_times,
  197.     Node_quotient,
  198.     Node_mod,
  199.     Node_plus,
  200.     Node_minus,
  201.     Node_cond_pair,        /* conditional pair (see Node_line_range) */
  202.     Node_subscript,
  203.     Node_concat,
  204.     Node_exp,
  205.  
  206.     /* unary operators   subnode is the expression to work on */
  207. /*10*/    Node_preincrement,
  208.     Node_predecrement,
  209.     Node_postincrement,
  210.     Node_postdecrement,
  211.     Node_unary_minus,
  212.     Node_field_spec,
  213.  
  214.     /* assignments   lnode is the var to assign to, rnode is the exp */
  215.     Node_assign,
  216.     Node_assign_times,
  217.     Node_assign_quotient,
  218.     Node_assign_mod,
  219. /*20*/    Node_assign_plus,
  220.     Node_assign_minus,
  221.     Node_assign_exp,
  222.  
  223.     /* boolean binaries   lnode and rnode are expressions */
  224.     Node_and,
  225.     Node_or,
  226.  
  227.     /* binary relationals   compares lnode and rnode */
  228.     Node_equal,
  229.     Node_notequal,
  230.     Node_less,
  231.     Node_greater,
  232.     Node_leq,
  233. /*30*/    Node_geq,
  234.     Node_match,
  235.     Node_nomatch,
  236.  
  237.     /* unary relationals   works on subnode */
  238.     Node_not,
  239.  
  240.     /* program structures */
  241.     Node_rule_list,        /* lnode is a rule, rnode is rest of list */
  242.     Node_rule_node,        /* lnode is pattern, rnode is statement */
  243.     Node_statement_list,    /* lnode is statement, rnode is more list */
  244.     Node_if_branches,    /* lnode is to run on true, rnode on false */
  245.     Node_expression_list,    /* lnode is an exp, rnode is more list */
  246.     Node_param_list,    /* lnode is a variable, rnode is more list */
  247.  
  248.     /* keywords */
  249. /*40*/    Node_K_if,        /* lnode is conditonal, rnode is if_branches */
  250.     Node_K_while,        /* lnode is condtional, rnode is stuff to run */
  251.     Node_K_for,        /* lnode is for_struct, rnode is stuff to run */
  252.     Node_K_arrayfor,    /* lnode is for_struct, rnode is stuff to run */
  253.     Node_K_break,        /* no subs */
  254.     Node_K_continue,    /* no stuff */
  255.     Node_K_print,        /* lnode is exp_list, rnode is redirect */
  256.     Node_K_printf,        /* lnode is exp_list, rnode is redirect */
  257.     Node_K_next,        /* no subs */
  258.     Node_K_exit,        /* subnode is return value, or NULL */
  259.     Node_K_do,        /* lnode is conditional, rnode stuff to run */
  260.     Node_K_return,
  261.     Node_K_delete,
  262.     Node_K_getline,
  263.     Node_K_function,    /* lnode is statement list, rnode is params */
  264.  
  265.     /* I/O redirection for print statements */
  266.     Node_redirect_output,    /* subnode is where to redirect */
  267.     Node_redirect_append,    /* subnode is where to redirect */
  268.     Node_redirect_pipe,    /* subnode is where to redirect */
  269.     Node_redirect_pipein,    /* subnode is where to redirect */
  270.     Node_redirect_input,    /* subnode is where to redirect */
  271.  
  272.     /* Variables */
  273.     Node_var,        /* rnode is value, lnode is array stuff */
  274.     Node_var_array,        /* array is ptr to elements, asize num of
  275.                  * eles */
  276.     Node_val,        /* node is a value - type in flags */
  277.  
  278.     /* Builtins   subnode is explist to work on, proc is func to call */
  279.     Node_builtin,
  280.  
  281.     /*
  282.      * pattern: conditional ',' conditional ;  lnode of Node_line_range
  283.      * is the two conditionals (Node_cond_pair), other word (rnode place)
  284.      * is a flag indicating whether or not this range has been entered.
  285.      */
  286.     Node_line_range,
  287.  
  288.     /*
  289.      * boolean test of membership in array lnode is string-valued
  290.      * expression rnode is array name 
  291.      */
  292.     Node_in_array,
  293.  
  294.     Node_func,        /* lnode is param. list, rnode is body */
  295.     Node_func_call,        /* lnode is name, rnode is argument list */
  296.  
  297.     Node_cond_exp,        /* lnode is conditonal, rnode is if_branches */
  298.     Node_regex,
  299.     Node_hashnode,
  300.     Node_ahash
  301. } NODETYPE;
  302.  
  303. /*
  304.  * NOTE - this struct is a rather kludgey -- it is packed to minimize
  305.  * space usage, at the expense of cleanliness.  Alter at own risk.
  306.  */
  307. typedef struct exp_node {
  308.     union {
  309.         struct {
  310.             union {
  311.                 struct exp_node *lptr;
  312.                 char *param_name;
  313.                 char *retext;
  314.                 struct exp_node *nextnode;
  315.             } l;
  316.             union {
  317.                 struct exp_node *rptr;
  318.                 struct exp_node *(*pptr) (struct exp_node *);
  319.                 struct re_pattern_buffer *preg;
  320.                 struct for_loop_header *hd;
  321.                 struct exp_node **av;
  322.                 short r_ent;    /* range entered */
  323.             } r;
  324.             char *name;
  325.             short number;
  326.             unsigned char recase;
  327.         } nodep;
  328.         struct {
  329.             AWKNUM fltnum;    /* this is here for optimal packing of
  330.                      * the structure on many machines
  331.                      */
  332.             char *sp;
  333.             short slen;
  334.             unsigned char sref;
  335.         } val;
  336.         struct {
  337.             struct exp_node *next;
  338.             char *name;
  339.             short length;
  340.             struct exp_node *value;
  341.         } hash;
  342. #define    hnext    sub.hash.next
  343. #define    hname    sub.hash.name
  344. #define    hlength    sub.hash.length
  345. #define    hvalue    sub.hash.value
  346.         struct {
  347.             struct exp_node *next;
  348.             struct exp_node *name;
  349.             struct exp_node *value;
  350.         } ahash;
  351. #define    ahnext    sub.ahash.next
  352. #define    ahname    sub.ahash.name
  353. #define    ahvalue    sub.ahash.value
  354.     } sub;
  355.     NODETYPE type;
  356.     unsigned char flags;
  357. #            define    MEM    0x7
  358. #            define    MALLOC    1    /* can be free'd */
  359. #            define    TEMP    2    /* should be free'd */
  360. #            define    PERM    4    /* can't be free'd */
  361. #            define    VAL    0x18
  362. #            define    NUM    8    /* numeric value is valid */
  363. #            define    STR    16    /* string value is valid */
  364. #            define    NUMERIC    32    /* entire field is numeric */
  365. } NODE;
  366.  
  367. #define lnode    sub.nodep.l.lptr
  368. #define nextp    sub.nodep.l.nextnode
  369. #define rnode    sub.nodep.r.rptr
  370. #define source_file    sub.nodep.name
  371. #define    source_line    sub.nodep.number
  372. #define    param_cnt    sub.nodep.number
  373. #define param    sub.nodep.l.param_name
  374.  
  375. #define subnode    lnode
  376. #define proc    sub.nodep.r.pptr
  377.  
  378. #define reexp    lnode
  379. #define rereg    sub.nodep.r.preg
  380. #define re_case sub.nodep.recase
  381. #define re_text sub.nodep.l.retext
  382.  
  383. #define forsub    lnode
  384. #define forloop    rnode->sub.nodep.r.hd
  385.  
  386. #define stptr    sub.val.sp
  387. #define stlen    sub.val.slen
  388. #define stref    sub.val.sref
  389. #define    valstat    flags
  390.  
  391. #define numbr    sub.val.fltnum
  392.  
  393. #define var_value lnode
  394. #define var_array sub.nodep.r.av
  395.  
  396. #define condpair lnode
  397. #define triggered sub.nodep.r.r_ent
  398.  
  399. #define HASHSIZE 101
  400.  
  401. typedef struct for_loop_header {
  402.     NODE *init;
  403.     NODE *cond;
  404.     NODE *incr;
  405. } FOR_LOOP_HEADER;
  406.  
  407. /* for "for(iggy in foo) {" */
  408. struct search {
  409.     short numleft;
  410.     NODE **arr_ptr;
  411.     NODE *bucket;
  412.     NODE *retval;
  413. };
  414.  
  415. /* for faster input, bypass stdio */
  416. typedef struct iobuf {
  417.     FILE * fd;
  418.     char *buf;
  419.     char *off;
  420.     short size;    /* this will be determined by an fstat() call */
  421.     short cnt;
  422.     char *secbuf;
  423.     short secsiz;
  424.     short flag;
  425. #    define        IOP_IS_TTY    1
  426. } IOBUF;
  427.  
  428. /*
  429.  * structure used to dynamically maintain a linked-list of open files/pipes
  430.  */
  431. struct redirect {
  432.     short flag;
  433. #        define        RED_FILE    1
  434. #        define        RED_PIPE    2
  435. #        define        RED_READ    4
  436. #        define        RED_WRITE    8
  437. #        define        RED_APPEND    16
  438. #        define        RED_NOBUF    32
  439.     char *value;
  440.     FILE *fp;
  441.     IOBUF *iop;
  442.     short pid;
  443.     short status;
  444.     long offset;        /* used for dynamic management of open files */
  445.     struct redirect *prev;
  446.     struct redirect *next;
  447. };
  448.  
  449. /* longjmp return codes, must be nonzero */
  450. /* Continue means either for loop/while continue, or next input record */
  451. #define TAG_CONTINUE 1
  452. /* Break means either for/while break, or stop reading input */
  453. #define TAG_BREAK 2
  454. /* Return means return from a function call; leave value in ret_node */
  455. #define    TAG_RETURN 3
  456.  
  457. /*
  458. #ifdef MSDOS
  459. #define HUGE    0x7fff
  460. #else
  461. #define HUGE    0x7fffffff
  462. #endif
  463. */
  464. #ifdef MACVERSION
  465. #define HUGE    0x7ffe
  466. #endif
  467.  
  468. /* -------------------------- External variables -------------------------- */
  469. /* gawk builtin variables */
  470. extern NODE *FS_node, *NF_node, *RS_node, *NR_node;
  471. extern NODE *FILENAME_node, *OFS_node, *ORS_node, *OFMT_node;
  472. extern NODE *FNR_node, *RLENGTH_node, *RSTART_node, *SUBSEP_node;
  473. extern NODE *IGNORECASE_node;
  474.  
  475. extern NODE **stack_ptr;
  476. extern NODE *Nnull_string;
  477. extern NODE *deref;
  478. extern NODE **fields_arr;
  479. extern short sourceline;
  480. extern char *source;
  481. extern NODE *expression_value;
  482.  
  483. extern NODE *variables[];
  484.  
  485. extern NODE *_t;    /* used as temporary in tree_eval */
  486.  
  487. extern char *myname;
  488.  
  489. extern short node0_valid;
  490. extern short field_num;
  491. extern short strict;
  492.  
  493.  
  494. /* ------------- Function prototypes or defs (as appropriate) ------------- */
  495. /*#ifdef __STDC__*/
  496. #ifdef MACVERSION
  497. extern    short parse_escape(char **);
  498. extern    FILE * devopen(char *, char *);
  499. extern    struct re_pattern_buffer *make_regexp(NODE *, short);
  500. extern    struct re_pattern_buffer *mk_re_parse(char *, short);
  501. extern    NODE *variable(char *);
  502. extern    NODE *install(NODE **, char *, NODE *);
  503. extern    NODE *lookup(NODE **, char *);
  504. extern    NODE *make_name(char *, NODETYPE);
  505. extern    short interpret(NODE *);
  506. extern    NODE *r_tree_eval(NODE *);
  507. extern    void assign_number(NODE **, double);
  508. extern    short cmp_nodes(NODE *, NODE *);
  509. extern    struct redirect *redirect(NODE *, short *);
  510. extern    short flush_io(void);
  511. extern    void print_simple(NODE *, FILE *);
  512. /* extern    void warning(char *,...); */
  513. extern    void warning(char *va_alist, ...);
  514. /* extern    void fatal(char *,...); */
  515. extern    void fatal(char *va_alist, ...);
  516. extern    void set_record(char *, short);
  517. extern    NODE **get_field(short, short);
  518. extern    NODE **get_lhs(NODE *, short);
  519. extern    void do_deref(void );
  520. extern    struct search *assoc_scan(NODE *);
  521. extern    struct search *assoc_next(struct search *);
  522. extern    NODE **assoc_lookup(NODE *, NODE *);
  523. extern    double r_force_number(NODE *);
  524. extern    NODE *r_force_string(NODE *);
  525. extern    NODE *newnode(NODETYPE);
  526. extern    NODE *dupnode(NODE *);
  527. extern    NODE *make_number(double);
  528. extern    NODE *tmp_number(double);
  529. extern    NODE *make_str_node(char *, short, short);
  530. extern    NODE *tmp_string(char *, short);
  531. extern    char *re_compile_pattern(char *, short, struct re_pattern_buffer *);
  532. extern    short re_search(struct re_pattern_buffer *, char *, short, short, short, struct re_registers *);
  533. extern    void freenode(NODE *);
  534. #endif
  535.  
  536.  
  537. /* ------------------------- Pseudo-functions ------------------------- */
  538. #ifdef MACVERSION
  539. #include "CodeResHelper.h" /* TMalloc etc */
  540. extern void JumpOnHAWKError(short inputErrorNumber);
  541.  
  542. /*********** early version, worked but was inefficient
  543. #define malloc(x) TMalloc(x)
  544. #define realloc(x, y) Trealloc(x, y)
  545. #define free(x) Tfree(x)
  546. ******************************************************/
  547.  
  548. #define malloc(x) Fmalloc(x)
  549. #define realloc(x, y) Frealloc(x, y)
  550. #define free(x) Ffree(x)
  551.  
  552. #define abort() JumpOnHAWKError(4)
  553. #define exit(x) JumpOnHAWKError(x)
  554. #define popen(str, w) NULL
  555. #define pclose(x) 1
  556. #define CheckForInterrupt() if (TaskWasInterrupted()) JumpOnHAWKError(999)
  557.  
  558. extern jmp_buf        envBuf;
  559.  
  560. #endif MACVERSION
  561.  
  562. #define is_identchar(c) (isalnum(c) || (c) == '_')
  563.  
  564.  
  565. #define    free_temp(n)    if ((n)->flags&TEMP) { deref = (n); do_deref(); } else
  566. /* Note 'else' is smothered by the usual following semicolon - purpose unknown. */
  567. #define    tree_eval(t)    (_t = (t),(_t) == NULL ? Nnull_string : \
  568.             ((_t)->type == Node_val ? (_t) : r_tree_eval((_t))))
  569. #define    make_string(s,l)    make_str_node((s),(l),0)
  570.  
  571. #define    cant_happen()    fatal("line %d, file: %s; bailing out", \
  572.                 __LINE__, __FILE__);
  573. #ifdef MEMDEBUG
  574. #define memmsg(x,y,z,zz)    fprintf(stderr, "malloc: %s: %s: %d %0x\n", z, x, y, zz)
  575. #define free(s)    fprintf(stderr, "free: s: %0x\n", s), do_free(s)
  576. #else
  577. #define memmsg(x,y,z,zz)
  578. #endif
  579.  
  580. #define    emalloc(var,ty,x,str)    if ((var = (ty) malloc((unsigned)(x))) == NULL)\
  581.                     fatal("%s: %s: can't allocate memory (%s)",\
  582.                     (str), "var", strerror(errno)); else\
  583.                     memmsg("var", x, str, var)
  584. #define    erealloc(var,ty,x,str)    if((var=(ty)realloc((char *)var,\
  585.                         (unsigned)(x)))==NULL)\
  586.                     fatal("%s: %s: can't allocate memory (%s)",\
  587.                     (str), "var", strerror(errno)); else\
  588.                     memmsg("re: var", x, str, var)
  589. #ifdef DEBUG
  590. #define    force_number    r_force_number
  591. #define    force_string    r_force_string
  592. #else
  593. #ifdef lint
  594. extern AWKNUM force_number();
  595. #endif
  596. #ifdef MSDOS
  597. extern double _msc51bug;
  598. #define    force_number(n)    (_msc51bug=(_t = (n),(_t->flags & NUM) ? _t->numbr : r_force_number(_t)))
  599. #else
  600. #define    force_number(n)    (_t = (n),(_t->flags & NUM) ? _t->numbr : r_force_number(_t))
  601. #endif
  602. #define    force_string(s)    (_t = (s),(_t->flags & STR) ? _t : r_force_string(_t))
  603. #endif
  604.  
  605. #define    STREQ(a,b)    (*(a) == *(b) && strcmp((a), (b)) == 0)
  606. #define    STREQN(a,b,n)    ((n) && *(a) == *(b) && strncmp((a), (b), (n)) == 0)
  607.  
  608. #define    WHOLELINE    (node0_valid ? fields_arr[0] : *get_field(0,0))
  609.  
  610.  
  611. #ifdef MACVERSION
  612. #if !defined(__STDC__) || __STDC__ <= 0
  613. #define volatile
  614. #endif
  615. #endif
  616.  
  617. /* Figure out what '\a' really is. */
  618. #ifdef __STDC__
  619. #define BELL    '\a'        /* sure makes life easy, don't it? */
  620. #else
  621. #    if 'z' - 'a' == 25    /* ascii */
  622. #        if 'a' != 97    /* machine is dumb enough to use mark parity */
  623. #            define BELL    '\207'
  624. #        else
  625. #            define BELL    '\07'
  626. #        endif
  627. #    else
  628. #        define BELL    '\057'
  629. #    endif
  630. #endif
  631.  
  632. #ifndef SIGTYPE
  633. #define SIGTYPE    void
  634. #endif
  635.  
  636. extern char casetable[];    /* for case-independent regexp matching */
  637.  
  638.  
  639. #ifdef MACVERSION
  640. #include "hAWK_recurse.h"
  641. #endif
  642.  
  643.